package A03;

public class Test {
    public static void main(String[] args) {
        Book bk1 = new Book(200);
        Book bk2 = new Book(130);
        bk1.Price();
        bk1.updatePrice();
        bk2.Price();
        bk2.updatePrice();
    }

}

class Book{
    int price;
    public Book(int price){
        this.price = price;
    }
    public void Price(){
        System.out.println("书本原先的价格为："+this.price);
    }

    public void updatePrice(){
        if(this.price > 150)
            this.price = 150;
        else if (this.price > 100 && this.price < 150) {
            this.price = 100;
        }
        System.out.println("书本更改后的价格为："+this.price);
    }
}
